package com.gzj.environment.admin.controller.log;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gzj.environment.framework.annotation.PermissionRequired;
import com.gzj.environment.framework.annotation.ResponseResult;
import com.gzj.environment.model.log.criteria.LogCriteria;
import com.gzj.environment.model.log.entity.Log;
import com.gzj.environment.module.log.annotation.AccessLog;
import com.gzj.environment.module.log.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: tsing
 * @create: 2021-01-25 10:34
 */
@RestController
@ResponseResult
@RequestMapping("/log/log")
public class LogController {

    @Autowired
    private LogService logService;

    /**
     * 分页条件查询
     * @param criteria 条件查询对象
     * @return
     */
    @GetMapping
    @PermissionRequired("log:list")
    @AccessLog(value = "条件查询日志信息")
    public Page<Log> list(LogCriteria criteria) {
        return logService.page(criteria);
    }
}
